import {getFocusList} from "@/api/adv";
export default {
    namespaced:true,
    state:{
        focusList:[]
    },
    mutations:{
        SET_FOCUS_LIST(state,focusList){
            state.focusList = focusList;
        }
    },
    actions:{
        async getFocusListAsync({state,commit,dispatch}){
            try{
                if(state.focusList.length>0) return;
                const response = await getFocusList();
                console.log(response.focusList)
                commit('SET_FOCUS_LIST',response.focusList)
            }catch (err){
                setTimeout(()=>{
                    dispatch("getFocusListAsync");
                },1000)
            }

        }
    }
}